<template>
  <div class="submit-info">
    <ul class="info">
      <li class="info_group">
        <div class="left">优惠劵</div>
        <div class="right">
          请选择
          <img src="../../../assets/icon/common/right_arrow.svg" alt="" />
        </div>
      </li>
      <li class="info_group jf">
        <div class="left">积分折扣</div>
        <div class="right"  @click="getJs">当前积分{{integral}} <i 
        :class="isJS == true ? 'active':''"
       
        ></i></div>
      </li>
      <li class="info_group">
        <div class="left">会员优惠</div>
        <div class="right">￥{{priceGroup.vipPrice}}</div>
      </li>
      <li class="info_group">
        <div class="left">快递运费</div>
        <div class="right">￥{{priceGroup.storePostage }}</div>
      </li>
    </ul>
    <div class="text">
      <div class="text_td">备注信息</div>
      <div class="text_area">
        <textarea
          name=""
          id=""
          cols="30"
          rows="10"
          placeholder="请添加备注 150个字以内"
          maxlength="150"
          @change="getText"
          
        ></textarea>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      isJS:false,
      
    }
  },
  props: {
   
    priceGroup:{
        type:Object,
    },
    integral:{
      type:String
    }
  },
  methods:{
      clickflag(){
          this.$emit("share-flag",!this.isflag)
      }
  },
  filters:{
    storePostage(val){
      if(val == 0) return "免运费"
    }
  },
  mounted(){
    //   console.log(this.priceGroup.vipPrice)
  },
  methods:{
    getJs(){
      this.isJS = !this.isJS
      if(this.isJS){
        this.$emit('share-isJS',1)
      }else{
        this.$emit('share-isJS',0)
      }

    },
    getText(e){
    
      this.$emit('share-inp',e.target.value)
    }
  }
};
</script>

<style lang="scss" scoped>
.submit-info {
  background-color: #fff;
  margin-top: 10px;
  .info {
    .info_group:nth-child(1) {
      .right {
        > img {
          width: 20px;
          height: 20px;
          margin-top: -1px;
          vertical-align: middle;
        }
      }
    }
    .info_group:nth-child(2) {
      .right {
        i {
          display: inline-block;
          width: 20px;
          height: 20px;
          border-radius: 50%;
          border: 1px solid #ccc;
          vertical-align: middle
          ;
          margin-left: 5px;
          margin-top: -3px;
        }

        i.active {
          display: inline-block;

          background: url(../../../assets/icon/common/cart_yes.png) no-repeat;
          background-size: 55% 55%;
          background-position: center center;
          border-radius: 50%;
          background-color: #e93323;
          border-color: #e93323;
        }
      }
    }
    .info_group {
      padding: 0 15px;
      height: 48px;
      font-size: 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid #f0f0f0;
      .left {
        color: #282828;
      }
      .right {
        color: #999;
      }
    }
  }
  .text {
    .text_td {
      font-size: 15px;
      color: #282828;
      height: 48px;
      line-height: 48px;
      padding: 0 15px;
    }
    .text_area {
      padding: 0 15px;
      textarea {
        width: 100%;
        font-size: 15px;
        color: #333;
        background-color: #f9f9f9;
        padding: 15px 12px;
        border: 0;
        height: 80px;
      }
    }
  }
}
</style>

